package com.example.zk.adapter

import android.widget.TextView
import com.blankj.utilcode.util.ToastUtils
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.Child
import com.example.zk.R

class ChildAdapter:BaseQuickAdapter<Child,BaseViewHolder>(R.layout.item_child) {
    override fun convert(holder: BaseViewHolder, item: Child) {
        Glide.with(context).load(item.extra).into(holder.getView(R.id.child_iv))
        holder.setText(R.id.child_tv,item.name)
        holder.getView<TextView>(R.id.child_tv).setOnClickListener {
            ToastUtils.showLong(item.name)
        }
    }
}